// 状态管理
import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useStore = defineStore('comic_session_id', () => {


    const comic_id = ref('')

    const chapters_id = ref([])
    const comic_title = ref('')
    const comic_short_title = ref('')


    const comic_sessions = ref([])

    const comic_chapter_isLocked = ref(false) //章节是否锁定



    const set_comic_id = (data) => {
        comic_id.value = data
    }

    const setChapters_id = (data) => {
        chapters_id.value = data
    }


    const set_comic_title = (data) => {
        comic_title.value = data
    }

    const set_comic_short_title = (data) => {
        comic_short_title.value = data
    }


    const set_comic_sessions = (data) => {
        comic_sessions.value = data.slice().reverse();
    }

    const set_comic_chapter_isLocked = (data) => {
        comic_chapter_isLocked.value = data
    }



    return { comic_id, chapters_id, comic_title, comic_short_title, comic_sessions, comic_chapter_isLocked, set_comic_id, setChapters_id, set_comic_title, set_comic_short_title, set_comic_sessions, set_comic_chapter_isLocked }
})